package dao.jpa;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import dao.VendaDAO;
import entity.GrupoProduto;
import entity.MarcaProduto;
import entity.Produto;
import entity.Venda;

@Repository
public class VendaJpaDAO extends GenericJpaDAO<Venda, Long> implements
		VendaDAO, Serializable {

	private static final long serialVersionUID = -7769051838144785979L;

	@Override
	public List<Venda> listarVendasPeriodo(Date dataInicial, Date dataFinal) {
		Criteria criteria = criarCriteria();
		
		//criteria.add(Restrictions.eq(propertyName, value))
		return criteria.add(Restrictions.between("dataVenda", dataInicial, dataFinal)).list();
	}
}
